package com.jddup.context;

import com.jddup.common.enums.JdbcTypeEnums;
import com.jddup.common.pojo.JddupConfig;

import javax.sql.DataSource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ZZB on 2017/12/4.
 */
public class JddConfigContext {
    private static JddupConfig jddupConfig;
    private static Map<String,String> datasourceNameUrlMap = new HashMap<>();
    private static Map<String ,DataSource> dataSourceMap = new HashMap<String, DataSource>();
    private static Map<String, JdbcTypeEnums> dbTypeMap = new HashMap<String, JdbcTypeEnums>();
    private static Map<String,List<String>> dataSourceScanPackageMap = new HashMap<String, List<String>>();
    private static Map<String ,String> entityScanPackageDatasourceMap = new HashMap<>();
    private static Map<String,List<Class>> scanPackageEntityMap = new HashMap<>();

    public static JddupConfig getJddupConfig() {
        return jddupConfig;
    }


    public static void setJddupConfig(JddupConfig jddupConfig) {
        JddConfigContext.jddupConfig = jddupConfig;
    }

    public static Map<String,String>  getDatasourceNameUrlMap(){
        return datasourceNameUrlMap;
    }

    public static Map<String, String> getEntityScanPackageDatasourceMap() {
        return entityScanPackageDatasourceMap;
    }

    public static Map<String, List<Class>> getScanPackageEntityMap() {
        return scanPackageEntityMap;
    }

    public static Map<String, DataSource> getDataSourceMap() {
        return dataSourceMap;
    }

    public static Map<String, List<String>> getDataSourceScanPackageMap() {
        return dataSourceScanPackageMap;
    }

    public static Map<String, JdbcTypeEnums> getDbTypeMap() {
        return dbTypeMap;
    }
}
